package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import com.lmx.repoDomain.tmodel.business.User;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 工作交接表
 */
@JsonApiResource(type = "workdelivery")
@Table(name = "tnb_work_delivery")
@Entity
// @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class WorkDelivery extends BaseEntity {

	private String remark;// 备注

	private User lastUpdateUser;// 更新操作者userid

	private Integer createDateTime;// 创建时间

	private User createUser;

	private Integer lastUpdateDateTime;// 更新时间

	private Employee sender;

	private Employee receiver;

	private Integer receiveTime;

	private Dicttype status;

	private String illChange;

	private String specialRemark;

	private String inBedNum;

	private String outOldPerson;

	private String newInOldPerson;

	// 已入住人数、请假/退住老人、新入住老人
	@Column(name = "illchange_remark",columnDefinition = "TEXT")
	public String getIllChange() {
		return illChange;
	}

	public void setIllChange(String illChange) {
		this.illChange = illChange;
	}

	@Column(name = "special_remark",columnDefinition = "TEXT")
	public String getSpecialRemark() {
		return specialRemark;
	}

	public void setSpecialRemark(String specialRemark) {
		this.specialRemark = specialRemark;
	}

	@Column(name = "inbed_num")
	public String getInBedNum() {
		return inBedNum;
	}

	public void setInBedNum(String inBedNum) {
		this.inBedNum = inBedNum;
	}

	@Column(name = "out_person")
	public String getOutOldPerson() {
		return outOldPerson;
	}

	public void setOutOldPerson(String outOldPerson) {
		this.outOldPerson = outOldPerson;
	}

	@Column(name = "newin_person")
	public String getNewInOldPerson() {
		return newInOldPerson;
	}

	public void setNewInOldPerson(String newInOldPerson) {
		this.newInOldPerson = newInOldPerson;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "status_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getStatus() {
		return status;
	}

	public void setStatus(Dicttype status) {
		this.status = status;
	}

	@Column(name = "receive_time")
	public Integer getReceiveTime() {
		return receiveTime;
	}

	public void setReceiveTime(Integer receiveTime) {
		this.receiveTime = receiveTime;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sender_id", foreignKey = @ForeignKey(name = "null"))
	public Employee getSender() {
		return sender;
	}

	public void setSender(Employee sender) {
		this.sender = sender;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "receiver_id", foreignKey = @ForeignKey(name = "null"))
	public Employee getReceiver() {
		return receiver;
	}

	public void setReceiver(Employee receiver) {
		this.receiver = receiver;
	}

	@Column(name = "lastUpdateDateTime")
	public Integer getLastUpdateDateTime() {
		return lastUpdateDateTime;
	}

	public void setLastUpdateDateTime(Integer lastUpdateDateTime) {
		this.lastUpdateDateTime = lastUpdateDateTime;
	}

	@Column(name = "createDateTime")
	public Integer getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Integer createDateTime) {
		this.createDateTime = createDateTime;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "createuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "lastupdateuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getLastUpdateUser() {
		return lastUpdateUser;
	}

	public void setLastUpdateUser(User lastUpdateUser) {
		this.lastUpdateUser = lastUpdateUser;
	}

	public WorkDelivery() {
	}

	@Column(name = "remark",columnDefinition = "TEXT")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
